package com.ysx.article.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ysx.article.dto.ApArticleDto;
import com.ysx.article.dto.ArticleBehaviourDtoQuery;
import com.ysx.article.pojo.ApArticle;
import com.ysx.common.pojo.PageInfo;
import com.ysx.common.pojo.PageRequestDto;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 文章信息表，存储已发布的文章 服务类
 * </p>
 *
 * @author ljh
 * @since 2021-09-08
 */
public interface ApArticleService extends IService<ApArticle> {

    PageInfo<ApArticle> pageByOrder(PageRequestDto<ApArticle> pageRequestDto);


    //展示详细的文章数据
    ApArticleDto detailByArticleId(Long articleId);
    //展示文章中的用户行为信息
    Map<String, Object> loadArticleBehaviour(ArticleBehaviourDtoQuery articleBehaviourDtoQuery);

    //计算分值保存到redis中
    void saveToRedis();

    Integer computeScore(ApArticle apArticle);

    List<ApArticle> loadMoreFromRedis(Integer channelId);
}
